package com.du.web.sample.util.state.leave;

import com.du.web.sample.util.state.AbstractFlow;
import com.du.web.sample.util.state.FlowVO;

import java.util.ArrayList;
import java.util.List;

/**
 * @desc:
 * @author: shuangdu
 * @date: 2022/11/30
 * @since: 1.8
 */
public class LeaveFlow extends AbstractFlow {

    private static List<FlowVO> flowList;
    static {
        flowList = new ArrayList<>();
        FlowVO<LeaveFlowParam> start = new FlowVO<>();
        start.setFrom(LeaveState.BEGIN)
                .setTo(LeaveState.MANAGER)
                .setHandler(new StartHandler());

        flowList.add(start);

        FlowVO<LeaveFlowParam> manager = new FlowVO<>();
        manager.setFrom(LeaveState.MANAGER)
                .setTo(LeaveState.HR)
                .setHandler(new ManangerHandler());

        flowList.add(manager);

        FlowVO<LeaveFlowParam> hr = new FlowVO<>();
        hr.setFrom(LeaveState.HR)
                .setTo(LeaveState.END)
                .setHandler(new HrHandler());
        flowList.add(hr);

        FlowVO<LeaveFlowParam> end = new FlowVO<>();
        end.setFrom(LeaveState.END)
                .setTo(LeaveState.END)
                .setHandler(new EndHandler());

        flowList.add(end);
    }

    public LeaveFlow() {
        pushMap(flowList);
    }

}
